package cn.tedu.adminsystem.webapi.controller;

import cn.tedu.adminsystem.service.IRoleService;
import cn.tedu.community.commons.pojo.admRole.vo.RoleListItemVO;
import cn.tedu.community.commons.restful.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private IRoleService service;

    @GetMapping("/list")
    public JsonResult<List<RoleListItemVO>> list(){
        List<RoleListItemVO> list = service.list();
        return JsonResult.ok(list);
    }
}
